GtkStyleContext: Handle empty areas when coalescing invalidation regions.
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 24 Nov 2010 02:02:01 +0000 (03:02 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:39:41 +0000 (15:39 +0100)
gtk/gtkstylecontext.c

index e5bd4cf68310c63e04111299fd6a5bf189a2e7ab..6dac9bdf3b06a86e3e199cf23bc09bce909e6901 100644 (file)
@@ -2728,21 +2728,28 @@ _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
   if (!priv->animations_invalidated)
     return;
 
-  for (l = priv->animations; l; l = l->next)
+  l = priv->animations;
+
+  while (l)
     {
       AnimationInfo *info;
+      GSList *cur;
       guint i;
 
-      info = l->data;
+      cur = l;
+      info = cur->data;
+      l = l->next;
 
       if (info->invalidation_region)
         continue;
 
-      /* FIXME: If this happens there's not much
-       * point in keeping the animation running.
-       */
+      /* There's not much point in keeping the animation running */
       if (info->rectangles->len == 0)
-        continue;
+        {
+          priv->animations = g_slist_remove (priv->animations, info);
+          animation_info_free (info);
+          continue;
+        }
 
       info->invalidation_region = cairo_region_create ();